<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <p id="test">hello world</p>
    <script>
        /* 
        style 下的属性
        cssText  -->批量操作css
        length(了解)
        getPropertyValue()  获取style属性里面的值
        item()  返回对应位置的css属性名
        removeProperty()  移出属性
        setProperty()     设置属性
         */
        var test=document.getElementById("test");
        test.style.cssText="color:red;background-color:#333;font-size:14px"
        console.log(test.style.getPropertyValue("color"))
        console.log(test.style)
        console.log(test.style.item(0))
        test.onclick=function(){
            this.style.removeProperty("color")
            this.style.setProperty("background-color","green")
        }
    </script>
</body>
</html>